﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

public class InteractiveObject:ViewableObject
{
    /**
     * creates a CollidableObject at 'placement' of type 'type'.
     * initializes origin, and
     * type. This will set the SpawnPointer for this instance
     * to null.
     * @param type an instance of ObjectFactory.TypeEnum which
     * specifies what type of CollidableObject to create
     * @param placement the world x,y,z coordinates that define
     * where this instance is placed.
     * @see ObjectFactory.TypeEnum
     */
    public InteractiveObject(InteractiveObject.Type type, Vector3 placement)
        : base(type, placement)
    {
        init(type, placement);
    }

    public override void draw()
    {
        base.draw();
    }
    
    public override void update(double elapsed)
    {
        base.update(elapsed);
    }

    public new class Type : ViewableObject.Type
    {
        //interactive world objects
        public static readonly Type Door = new Type();
        public static readonly Type Crevice = new Type();

        //actual class data

        /**
         * this is a dummy constructor.
         */
        protected Type() { }

        /**
         * Private constructor.
         * This private constructor ensures that only 
         * the pre-specified Type objects can be used 
         * and compared against.
         * @param origin
         * @param collision
         * @param basic
         * @param destruction
         */
        protected Type(Vector3 origin, Vector3 collision)
        {
        }

        public static new InteractiveObject.Type getType(ObjectFactory.TypeEnum type)
        {
            switch (type)
            {
                case ObjectFactory.TypeEnum.Door: return Door;
                case ObjectFactory.TypeEnum.Crevice: return Crevice;
            }
            return null;
        }

        protected virtual Animation getInteractAnimation()
        {
            return new Animation(
                "interact",//name
                12,//framerate
                true,//loopable
                new ArrayList { });//framelist
        }
    }
}
